<?php

use App\Rpc\RpcProvider;
use Swoft\Rpc\Client\Client as ServiceClient;
use Swoft\Rpc\Client\Pool as ServicePool;

return [
    'userProvider' => [
        'class' => RpcProvider::class,
        'service_name' => 'service-user',    // 服务名
        'serviceHelper' => bean(\App\Common\ServiceHelper::class)
    ],
    'user'              => [
        'class'   => ServiceClient::class,
        // 使用consul时候注释掉
//        'host'    => '172.25.0.52',
//        'port'    => 8003,
        'setting' => [
            'timeout'         => 60.0,
            'connect_timeout' => 60.0,
            'write_timeout'   => 60.0,
            'read_timeout'    => 60.0,
            'service_id'      => 'service-user-rpc',
        ],
        'packet'  => bean('rpcClientPacket'),
        'provider' => bean('userProvider'),
    ],
    'user.pool'         => [
        'class'  => ServicePool::class,
        'client' => bean('user'),
    ],
];